# deal with problems
#
require "rubygems"

module Amadeusdsl
    module Error 
        extend self

        def BaseError(input) 
            case input
            when "ERRIM"
                abort "Aborting :: Ill formatted message"
            when "ERREC"
                abort "Aborting :: Empty command"
            when "ERRNR"
                abort "Aborting :: No results matching your request"
            when "ERRXX"
                abort "Aborting :: Something pretty serious happened."
            else
            end
        end

        def Error(input,hash) 
            hash.each_key{ |key| if key.eql? input then puts hash[key] end}
            BaseError(input)
        end

        def Abort(input,hash)
            hash.each_key{ |key| if key == input then abort hash[key] end}
            BaseError(input)
        end

    end
end
